<!DOCTYPE html>
<html>
<head>
    <title>API测试</title>
    <meta charset="UTF-8">
</head>
<body>
    <h1>初访记录API测试</h1>
    <button onclick="testAPI()">测试API</button>
    <div id="result"></div>

    <script>
        async function testAPI() {
            try {
                const response = await fetch('http://localhost:8080/api/visit-record/initial', {
                    method: 'GET',
                    headers: {
                        'Content-Type': 'application/json'
                    }
                });
                
                const data = await response.json();
                console.log('API响应:', data);
                
                document.getElementById('result').innerHTML = 
                    '<pre>' + JSON.stringify(data, null, 2) + '</pre>';
            } catch (error) {
                console.error('API错误:', error);
                document.getElementById('result').innerHTML = 
                    '<p style="color: red;">错误: ' + error.message + '</p>';
            }
        }
    </script>
</body>
</html> 